interface DataType {
	[key: string]: any;
}

let store: DataType = {};
let userStore: DataType = {};

export const cacheData = (key: string, data: any, user: boolean = true) => {
	return user ? (userStore[key] = data) : (store[key] = data);
};

export const getData = (key: string, user: boolean = true) => {
	return user ? userStore[key] : store[key];
}

export const clearCache = () => {
	store = {};
}


export const clearUserCache = () => {
	userStore = {};
}
